<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>v-on：绑定事件监听器</title>
    <script type="text/javascript" src="../assets/js/vue.js"></script>
</head>

<body>
    <h1>
        v-on：绑定事件监听器
    </h1>
    <hr>
    <div id="app">
        本场得分 {{count}}
        <br>
        <input type="text" @keyup.enter="onEnter">
        <br>
        <button @click="point">加分</button>
        <button @click="deduction">减分</button>
    </div>

    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                count: 2,
            },
            methods: {
                point: function() {
                    this.count++;
                },
                deduction: function() {
                    this.count--;
                }
            }
        })
    </script>
</body>

</html>